package com.chf.bean;

import org.w3c.dom.stylesheets.LinkStyle;

import java.util.List;

/**
 * 要求：bean的属性名和数据库的字段名保持一致；可以忽略大小写；
 *      dbutils的要求；
 */
public class Blog {
    // 属性
    private Integer id;
    private String title;
    private Integer author_id;
//    一对一
    private Author author;
//    一对多
    private List<Post> posts;

    // 行为
    public Integer getAuthor_id() {
        return author_id;
    }

    public void setAuthor_id(Integer author_id) {
        this.author_id = author_id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Author getAuthor() {
        return author;
    }

    public void setAuthor(Author author) {
        this.author = author;
    }

    public List<Post> getPosts() {
        return posts;
    }

    public void setPosts(List<Post> posts) {
        this.posts = posts;
    }

    @Override
    public String toString() {
        return "Blog{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", author_id=" + author_id +
                ", author=" + author +
                ", posts=" + posts +
                '}';
    }
}
